package crackerx.game.level;

import android.view.KeyEvent;
import crackerx.game.graphics.GameBitMaps;
import crafex.engine.graphics.GraphicTools;
import crafex.engine.level.Level;
import crafex.engine.level.LevelHandler;
import crafex.engine.system.Command;
import crafex.engine.system.Crafex;
import crafex.engine.tools.Button;
import crafex.engine.tools.IntVertex2D;

public class GameOptions extends Level{

	private static final long serialVersionUID = -1738495559860137052L;

	public GameOptions(IntVertex2D bounds, Level currentLevel){
		super(bounds, currentLevel);
		clearGUI();
		addToGUI(new Button(GraphicTools.makeTextButtonImage("new", GameBitMaps.six_letter_button, GameBitMaps.purple_text, new IntVertex2D(6, 6), false), (int) (Crafex.getScreenWidth() * .25),
				(int) (Crafex.getScreenHeight() * .5), new Command(this, "gotoGameOptions")));
		addToGUI(new Button(GraphicTools.makeTextButtonImage("load", GameBitMaps.six_letter_button, GameBitMaps.purple_text, new IntVertex2D(6, 6), false), (int) (Crafex.getScreenWidth() * .75),
				(int) (Crafex.getScreenHeight() * .5), null));//TODO add load command
		
	}
	
	public void gotoGameOptions(){
		LevelHandler.setLevel(new GameSelection(Level.bounds, this));
	}
	
	@Override
	public void buttonHandler(int keyCode){
		if(keyCode == KeyEvent.KEYCODE_BACK){
			gotoPrev();
		}
		super.buttonHandler(keyCode);
	}
}
